<?php 
	session_start();
	include_once ('./fonctions/fonctions.php');
	include_once ('./fonctions/constantes.php');
?>
	
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link href="style.css" rel="stylesheet" type="text/css" media="all" />
	<title>Hivana Blog</title>
	<!-- TinyMCE -->
	<script type="text/javascript" src="./tiny_mce/tiny_mce.js"></script>
	<script type="text/javascript">
	tinyMCE.init({
			// General options
			mode : "textareas",
			theme : "advanced",
			plugins : "autolink,lists,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",

			// Theme options
			theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,|,,ltr,rtl,styleselect,formatselect,fontselect,fontsizeselect",
			theme_advanced_buttons2 : "outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,code,|,forecolor,backcolor,hr,removeformat,sub,sup,|,charmap,iespell,media,advhr,fullscreen,cite,abbr,acronym,del,ins,attribs",
			theme_advanced_buttons3 : "",
			theme_advanced_buttons4 : "",
			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left",
			theme_advanced_statusbar_location : "bottom",
			theme_advanced_resizing : true,

			// Skin options
			skin : "o2k7",
			skin_variant : "silver",

			// Example content CSS (should be your site CSS)
			content_css : "css/example.css",

			// Drop lists for link/image/media/template dialogs
			template_external_list_url : "js/template_list.js",
			external_link_list_url : "js/link_list.js",
			external_image_list_url : "js/image_list.js",
			media_external_list_url : "js/media_list.js",

			// Replace values for the template plugin
			template_replace_values : {
					username : "Some User",
					staffid : "991234"
			}
	});
	</script>
	<!-- /TinyMCE -->
</head>

<body>
<div id="contenu">
	<div id="page">
		<nav>
			<div class="menu"><ul>
				<?php
				if (isset($_GET['page'])) 
				{
					$page=$_GET['page'];
				}
				?>
				<li><a href="index.php?page=accueil">Accueil</a></li>
				<li><a href="index.php?page=articles">Articles</a></li>
				<li><a href="index.php?page=recettes">Recettes</a></li>
				<li><a href="index.php?page=textes">Textes</a></li>
				<li><a href="index.php?page=galeries">Galeries 3D</a></li>
				<li><a href="index.php?page=creations">Ressources</a></li>
				<li><a href="index.php?page=contact">Contact</a></li>
				</ul>
			</div>
		</nav>
		
		<header>
			<h1>Hivana<h1>
		</header>

		<section>
			<?php
			if (isset($_GET['page'])) 
			{
				$page=$_GET['page'];
				switch ($page)
				{
					case 'accueil':
						?>
						<article>
							<div id="tableau"><?php include ('./modules/articles.php'); ?></div>
							<div id="tableau"><?php include ('./modules/articles_categories.php'); ?></div>
						</article>
							<div class="citation">
								<?php include ('./modules/citations.php'); ?>
							</div>
						<article>
							<div id="tableau-col">
								<?php include ('./modules/recettes_hasard.php'); ?>
							</div>
							<div id="tableau-col">
								<?php include ('./modules/recettes_derniere.php'); ?>
							</div>
							<hr/>
						</article>
						<article>
							<div id="tableau-col">
								<?php include ('./modules/textes_recent.php'); ?>
							</div>
							<div id="tableau-col">
								<?php include ('./modules/textes_hasard.php'); ?>
								<?php include ('./modules/textes_livre.php'); ?>
							</div>
							<hr/>
						</article>
						<article>
							<div id="tableau-col">
								<div id="tableau-col">
									<?php include ('./modules/galeries_derniere.php'); ?>
								</div>
								<div id="tableau-col">
									<?php include ('./modules/galeries_hasard.php'); ?>
								</div>
								
							</div>
							
							<div id="tableau-col">
								<?php include ('./modules/galeries.php'); ?>
							</div>
							<hr/>
						</article>
						<?php
					break;
					case 'articles':
						?>
						<article><?php include ('./pages/articles.php'); ?></article>
						<?php
					break;
					case 'recettes':
						?>
						<article><?php include ('./pages/recettes.php'); ?></article>
						<?php
					break;
					case 'textes':
						?>
						<article><?php include ('./pages/textes.php'); ?></article>
						<?php
					break;
					case 'galeries':
						?>
						<article><?php include ('./pages/galeries.php'); ?></article>
						<?php
					break;
					case 'creations':
						?>
						<article><?php include ('./pages/creations.php'); ?></article>
						<?php
					break;
					case 'contact':
						?>
						<article><?php include ('./pages/contact.php'); ?></article>
						<?php
					break;
					case 'hivana':
						?>
						<article><?php include ('./admin/admin_index.php'); ?></article>
						<?php
					break;
					case 'admin_categories_articles':
						?>
						<article><?php include ('./admin/admin_menu.php'); ?></article>
						<article><?php include ('./admin/admin_categories_articles.php'); ?></article>
						<?php
					break;
					case 'admin_articles':
						?>
						<article><?php include ('./admin/admin_menu.php'); ?></article>
						<article><?php include ('./admin/admin_articles.php'); ?></article>
						<?php
					break;
					case 'admin_categories_creations':
						?>
						<article><?php include ('./admin/admin_menu.php'); ?></article>
						<article><?php include ('./admin/admin_categories_creations.php'); ?></article>
						<?php
					break;
					case 'admin_creations':
						?>
						<article><?php include ('./admin/admin_menu.php'); ?></article>
						<article><?php include ('./admin/admin_creations.php'); ?></article>
						<?php
					break;
					case 'admin_recettes':
						?>
						<article><?php include ('./admin/admin_menu.php'); ?></article>
						<article><?php include ('./admin/admin_recettes.php'); ?></article>
						<?php
					break;
					case 'admin_categories_recettes':
						?>
						<article><?php include ('./admin/admin_menu.php'); ?></article>
						<article><?php include ('./admin/admin_categories_recettes.php'); ?></article>
						<?php
					break;
					case 'admin_chapitres':
						?>
						<article><?php include ('./admin/admin_menu.php'); ?></article>
						<article><?php include ('./admin/admin_chapitres.php'); ?></article>
						<?php
					break;
					case 'admin_textes':
						?>
						<article><?php include ('./admin/admin_menu.php'); ?></article>
						<article><?php include ('./admin/admin_textes.php'); ?></article>
						<?php
					break;
					case 'admin_categories_textes':
						?>
						<article><?php include ('./admin/admin_menu.php'); ?></article>
						<article><?php include ('./admin/admin_categories_textes.php'); ?></article>
						<?php
					break;
					case 'admin_images':
						?>
						<article><?php include ('./admin/admin_menu.php'); ?></article>
						<article><?php include ('./admin/admin_images.php'); ?></article>
						<?php
					break;
					case 'admin_galeries':
						?>
						<article><?php include ('./admin/admin_menu.php'); ?></article>
						<article><?php include ('./admin/admin_galeries.php'); ?></article>
						<?php
					break;
					case 'admin_citations':
						?>
						<article><?php include ('./admin/admin_menu.php'); ?></article>
						<article><?php include ('./admin/admin_citations.php'); ?></article>
						<?php
					break;
					case 'admin_medias':
						?>
						<article><?php include ('./admin/admin_menu.php'); ?></article>
						<article><?php include ('./admin/admin_medias.php'); ?></article>
						<?php
					break;
					
					default:
						// Défini dans le else
					break;
				}
			}
			else
			{
				header('Location: index.php?page=accueil'); 
			}
			include ('./modules/facebook.php');
			?>
		</section>
		
		<footer>
			<?php $annee = date("Y"); ?>
			<p>Tous droits réservés Hivana 2000-<?php echo $annee; ?> - RSS - <a href="index.php?page=hivana">Administration</a></p>
			
			
		</footer>
	</div>
</div>
<script type="text/javascript">
	if (document.location.protocol == 'file:') {
		alert("The examples might not work properly on the local file system due to security settings in your browser. Please use a real webserver.");
	}
</script>
</body>
</html>